/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kmcsoft.goldshop.shop;

import java.util.Collection;
import org.zkoss.zk.ui.Component;
import org.zkoss.zkplus.databind.TypeConverter;

/**
 *
 * @author kmcsoft02
 */
public class SizeConverter implements TypeConverter {

    public Object coerceToUi(Object val, Component comp) {
        if (val instanceof Collection) {
            return "" + ((Collection) val).size();
        }
        return "";
    }

    public Object coerceToBean(Object val, Component comp) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
